package jtk.project4.fleet.screen.edittirehistory;

//import sun.font.CreatedFontTracker;
import java.awt.FlowLayout;

//import jtk.project4.fleet.domain.TireHistory;
import jtk.project4.fleet.field.DriverLicenseInformationField;
import jtk.project4.fleet.field.GeneralInformationField;
import jtk.project4.fleet.field.MicellaneousField;
import jtk.project4.fleet.field.PersonnelInformationField;
import jtk.project4.fleet.field.EditTireHistory1Field;
import jtk.project4.fleet.field.EditTireHistoryField;
import nl.coderight.jazz.form.FormHeader;
import nl.coderight.jazz.form.FormLayout;
import nl.coderight.jazz.form.FormView;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.field.button.PushButton;

public class AddTireHistoryView extends FormView {
	private FormHeader formHeader;
	private PushButton submitButton;
	private PushButton cancelButton;
	@Override
	protected void init() {
		// TODO Auto-generated method stub
		CreateField();
		CreateLayout();
	}	
	
	private void CreateField(){
		submitButton = new PushButton("Submit");
		cancelButton = new PushButton("Cancel");
	}
	
	private void CreateLayout(){
		setHeader(CreateHeader());
		addField(CreateForm());
	}
	private FormHeader CreateHeader(){
		formHeader = new FormHeader();
		formHeader.setTitle("EditTireHistory.header.form");
		return formHeader;
	}
	
	private GroupControl CreateForm(){
		GroupControl form = new GroupControl();
		form.addField(createTireUsageDetails());
		form.addField(CreateButton(),SOUTH);
		return form;
	}
	
	private GroupControl createTireUsageDetails() {
		GroupControl form = new GroupControl();
		form.setLayout(new FormLayout())
		.addField(new EditTireHistoryField("EditTireHistory"))
		.addField(new EditTireHistory1Field("EditTireHistory"))
		;				
		form.setTitle("Tires Usege Detil");
		
		return form;
	}
	private GroupControl CreateButton(){
		GroupControl button = new GroupControl();
		button.setLayout(new FlowLayout(FlowLayout.RIGHT));
		button.addField(submitButton);
		button.addField(cancelButton);
		return button;
	}
}